package com.azier.kapacitor.script.node;

import com.azier.kapacitor.script.method.Field;
import com.azier.kapacitor.script.method.Quiet;
import com.azier.kapacitor.script.method.Tag;
import com.azier.kapacitor.script.node.nodebind.CommonNodeBind;

import java.util.ArrayList;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Create a node that can delete tags or fields.
**/
/**
创建一个可以删除标签或字段的节点。
**/
public class DeleteNode extends AbstractNode implements CommonNodeBind{
    private static final String name = "delete";

    public DeleteNode() {
        super(new ArrayList<>(),new ArrayList<>(),name);
    }

    /**
    Delete a field.
    **/
    /**
    删除一个字段。
    **/
    public DeleteNode field(String name){
        Field field = new Field(name);
        super.addMethod(field);
        return this;
    }
    /**
    Suppress all error logging events from this node.
    **/
    /**
    禁止来自此节点的所有错误记录事件。
    **/
    public DeleteNode quiet(){
        Quiet quiet = new Quiet();
        super.addMethod(quiet);
        return this;
    }
    /**
    Delete a tag.
    **/
    /**
    删除标签。
    **/
    public DeleteNode tag(String name){
        Tag tag = new Tag(name);
        super.addMethod(tag);
        return this;
    }
}